<?php
  // rss chanel
  require_once dirname(__FILE__)."/purin2/rss/rss.php";
  require_once dirname(__FILE__)."/purin2/core/core.php";
  // which file?
  $score = (@$_REQUEST['score']=='true');
  // load entire chat
  if ($score) {
    puRssBegin('AYASS Score','Score in AYASS game','ayass@centrum.sk','http://ayass.xf.cz/rss.php?score=true');
    $chat = file_get_contents('score.txt');
    $chat = str_replace('message">','message"> - ',$chat);
    puRssItem(md5($chat),'New score achieved','http://ayass.xf.cz/','http://ayass.xf.cz/',$chat);
  } else {
    puRssBegin('AYASS Chat','Chat from AYASS game','ayass@centrum.sk','http://ayass.xf.cz/rss.php');
    $chat = file_get_contents('chat.txt');
    $chat = str_replace('message">','message"> - ',$chat);
    puRssItem(md5($chat),'New message','http://ayass.xf.cz/','http://ayass.xf.cz/',$chat);
  }
  puRssEnd();
?>